import request from '@/utils/request'

// 查询仓库列表
export function listWarehouse(query) {
  return request({
    url: '/ck/setup/findAll_ws/',
    method: 'post',
    params: query
  })
}

// 查询仓库详细
export function getWarehouse(warehouseId) {
  return request({
    url: '/ck/setup/findAll_ws/',
    method: 'post',
    params: { warehouse_id: warehouseId }
  })
}

// 新增仓库
export function addWarehouse(data) {
  return request({
    url: '/ck/setup/save_ws/',
    method: 'post',
    params: data
  })
}

// 修改仓库
export function updateWarehouse(data) {
  return request({
    url: '/ck/setup/save_ws/',
    method: 'post',
    params: data
  })
}

// 删除仓库
export function delWarehouse(warehouseId) {
  // 系统中没有删除仓库的API，可以使用冻结功能代替
  return request({
    url: '/ck/setup/updateFrozen/',
    method: 'post',
    params: { id: warehouseId, frozen_flag: 'Y' }
  })
} 